home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / ms_dos.622 / spatch.bat < prev    next >
DOS Batch File  |  1994-05-31  |  3KB  |  135 lines

  1. @echo off
  2.  
  3.     REM *************************************************
  4.     REM *            SPATCH.BAT                         *
  5.     REM *   Patch to allow swapfile.exe to work with    *
  6.     REM *   msdos 6. Designed to be used only once      *
  7.     REM *   for this specific purpose                   *
  8.     REM *************************************************
  9.  
  10. set OLDPATH=%PATH%
  11. if "%1" == "" goto usage
  12. if "%1" == "/?" goto usage
  13. if "%1" == "-?" goto usage
  14.  
  15. set WINPATH=%1
  16. set PATH=%WINPATH%;%OLDPATH%
  17. if not exist %WINPATH%\system\swapfile.exe goto ERROR2
  18. if not exist %WINPATH%\winver.exe goto ERROR4
  19. attrib -r -h -s %WINPATH%\system\swapfile.exe
  20.  
  21. echo                             NOTE
  22. echo;
  23. echo This batch program modifies your Windows 3.0/3.0a SWAPFILE.EXE file for
  24. echo use with MS-DOS 6. A backup of the file will be saved as SWAPFILE.SAV
  25. echo;
  26. echo;
  27.  
  28. pause
  29.  
  30. find "3.00a" %WINPATH%\WINVER.EXE > nul
  31.  
  32. if not errorlevel 1 goto win3a
  33.  
  34. find "3.00" %WINPATH%\WINVER.EXE > nul
  35.  
  36. if not errorlevel 1 goto win30
  37.  
  38. goto ERROR5
  39.  
  40.  
  41. :WIN30
  42. set ADDR=2dc0
  43. goto modswap
  44.  
  45. :WIN3A
  46. set ADDR=2df2
  47.               
  48. :MODSWAP
  49. copy   %WINPATH%\system\swapfile.exe  swapfile.sav
  50. copy   %WINPATH%\system\swapfile.exe  swapfile.dbg
  51.  
  52. echo n swapfile.dbg      > spatch.src
  53. echo l                  >> spatch.src
  54. echo e %ADDR% b8,5,0,90 >> spatch.src
  55. echo w                  >> spatch.src
  56. echo q                  >> spatch.src
  57.  
  58. debug swapfile.dbg       < spatch.src > NUL
  59. if errorlevel goto error3
  60.  
  61. copy  swapfile.dbg  %WINPATH%\system\swapfile.exe
  62. del   swapfile.dbg
  63. goto success
  64.  
  65. :USAGE
  66.  
  67.     echo;
  68.     echo    Patches the Windows 3.0/3.0a SWAPFILE.EXE for use with MS-DOS 6 
  69.     echo.
  70.     echo      SPATCH [drive:][Windows directory]
  71.     echo.
  72.     echo      EXAMPLE: SPATCH C:\WINDOWS
  73.     echo;
  74.     echo    NOTE: Make sure you use the correct path for Windows
  75.     echo;
  76.  
  77. goto end
  78.  
  79. :ERROR1
  80.  
  81.    echo;
  82.    echo    Can not find the Windows directory. Make sure you enter
  83.    echo    the correct path.
  84.    echo;
  85.  
  86. goto end
  87.  
  88. :ERROR2
  89.  
  90.    echo;
  91.    echo    Can not find SWAPFILE.EXE in your WINDOWS\SYSTEM subdirectory.
  92.    echo;
  93.  
  94. goto end
  95.  
  96.  
  97. :ERROR3
  98.  
  99.    echo    Error patching swapfile.exe. Original swapfile.exe being restored.
  100.    echo    Look at the readme file to answer any questions.
  101.    echo;
  102.  
  103. copy swapfile.sav %WINPATH%\system\swapfile.exe
  104. del  swapfile.sav
  105.  
  106. goto end
  107.  
  108. :ERROR4
  109.  
  110.    echo    Error.  Could not find WINVER.EXE.
  111.    echo    Cannot determine your Windows version.
  112.  
  113. goto end
  114.  
  115. :ERROR5
  116.  
  117.    echo    Error.  Unrecognized Windows version.
  118.  
  119. goto end
  120.  
  121. :SUCCESS
  122.    echo;
  123.    echo    Your SWAPFILE.EXE file was modified successfully. After you confirm
  124.    echo    that the file works correctly, you can delete SWAPFILE.SAV.
  125.    echo;
  126.  
  127. if exist spatch.src del spatch.src
  128.  
  129. :END
  130.  
  131. set ADDR=
  132. set WINPATH=
  133. set PATH=%OLDPATH%
  134. set OLDPATH=
  135.